home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Reference Guide
/
C-C++ Interactive Reference Guide.iso
/
c_ref
/
csource3
/
163_01
/
perror.c
< prev
next >
Wrap
Text File
|
1988-02-01
|
640b
|
15 lines
/*
** print string s, followed by a colon and the message corresponding to
** the current value of _errno
*/
extern int *stderr, fputs(), fputc(), errno, sys_nerr, sys_errlist[];
perror(s) char *s; {
fputs(s, stderr);
fputs(": ", stderr);
if(errno < sys_nerr)
fputs(sys_errlist[errno], stderr);
else
fputs("Undefined error", stderr);
fputc('\n', stderr);
}